<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

/**
 *  App渠道管理
 */
class AppChannel extends Model
{
    protected $table = 'app_channel';

    static function getChannels()
    {
        $data = ['all' => '所有渠道'];
        $data = self::pluck('channel_name', 'channel')->toArray();
        // $data = [['id' => '', 'text' => '全部渠道']];
        return $data;
    }

    static function getChannelsAll()
    {
        $ret = ['0'=>'所有渠道'];
        $data = self::pluck('channel_name', 'channel')->toArray();

        foreach ($data as $item=>$val) {
            $ret[$item] = $val;
        }
        return $ret;
    }
}
